/**
 * OPay Inc.
 * Copyright (c) 2016-2022 All Rights Reserved.
 */
package cc.dd.marketing.system.exception.base;

import org.apache.commons.lang3.StringUtils;

/**
 * @author sufeng.dong
 * @version $Id: BusinessExceptionAssert.java, v 0.1 2022-05-24 2:37 PM sufeng.dong Exp $$
 */
public interface BusinessExceptionAssert extends IResponseEnum, Assert {

    @Override
    default BaseException newException(String args) {
        String msg = this.getMessage();
        if (StringUtils.isNotBlank(args)){
            msg.concat("_").concat(args);
        }
        return new BusinessException(this, msg);
    }

    @Override
    default BaseException newException(Throwable t, String args) {
        String msg = this.getMessage();
        if (StringUtils.isNotBlank(args)){
            msg.concat("_").concat(args);
        }
        return new BusinessException(this, msg, t);
    }

}